Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

[git] Checkout A new remote branch

[git] Checkout A new remote branch

v-model 資料雙向綁定/各種表單運用

v-model 資料雙向綁定/各種表單運用

2. SpringBoot使用jms整合IBM MQ

2. SpringBoot使用jms整合IBM MQ






留言討論